package cn.yunhe.service.impl;

import cn.yunhe.dao.TypeDao;
import cn.yunhe.model.Type;
import cn.yunhe.service.TypeBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;

/*spring注解*/
@Service(value = "typeBiz")
public class TypeBizImpl implements TypeBiz {

    /*spring注解*/
    @Autowired
    @Qualifier("typeDao")
    TypeDao typeDao;

    @Override
    public boolean insertType(Type type) {
        return typeDao.insertType(type);
    }

    @Override
    public boolean updateType(Type type) {
        return typeDao.updateType(type);
    }

    @Override
    public boolean deleteType(Integer hid) {
        return typeDao.deleteType(hid);
    }

    @Override
    public Type getById(Integer hid){
        return typeDao.getById(hid);
    }

    @Override
    public List<Type> searchType(String hql) {
        return typeDao.searchType(hql);
    }

    @Override
    public List<Type> searchType(Type type) {
        return typeDao.searchType(type);
    }

    public TypeDao getTypeDao() {
        return typeDao;
    }

    public void setTypeDao(TypeDao typeDao) {
        this.typeDao = typeDao;
    }
}
